<html>
<?php
include ("../../../../PCO.php");
include ("../../../../global-themis/functions/function_graph_2.php");
include ("../../../../global-themis/functions/functions.php");
include ("../../../../global-themis/Classes/client.class");
$rem=array();
$num_cli="";
$content="";
if(isset($_GET['num_cli'])){
	$num_cli=$_GET['num_cli'];
	if(strlen($num_cli)==6)
	$num_cli="0".$num_cli."";
	$client= new Client();
	$client->setNum($num_cli);
	$rem=$client->getRemisePortefeuilleByNum($num_cli);
	$count=count($rem);
	// c'est pour eviter l'affichage du scrollbar-x donc on ajoute des lignes vides si la taille de $rem <6.
	if($count < 6) {
		$count=6 -$count;
	}
	else {
		$count=0;
	}
	if(empty($rem)){
		$content.="Aucune remise Portefeuille trouvee...";
	}
	else {
		$content.="<table id='tab_rem' class='tablescroll' width='100%'>
				   <thead>
					   <td>REM</td>
					   <td>NAT</td>
					   <td>DATE REM</td>
					   <td>DEV</td>
					   <td>MON</td>
					   <td>GAR</td>
					   <td>VAL</td>
					</thead>
					<tbody>";
		foreach($rem as $r){
			$content.="<tr><td>".$r['PTFREMNRE']."<td>".$r['NAT']."<td>".reConvertDate($r['PTFREMDRE'])."<td>".$r['DEV']."<td>".$r['PTFREMMON']."<td>".$r['PTFREMMOG']."<td>".$r['VAL']."</td>";
		}
		$i=0;
		while ($i<$count){
			$content.='<tr><td colspan="7">&nbsp;</td></tr>';
			$i++;
		}
		$content.="</tbody></table>";
	}
}
?>
<head>

<script src="../../../../global-themis/js/jquery.js"></script>
<script src="../../../../global-themis/js/jquery.tablescroll.js"></script>
<link rel='stylesheet' type='text/css' href='../../../../global-themis/css/themisstyle.css'/>				
		<script>
			$(document).ready(function(){
				$('#tab_rem').tableScroll('undo');
			});

		</script>

</head>
<body>
<div>
10 dernieres remises Portefeuille:
<div id='container' >
	<?php
		echo $content;
	?>
</div>
</body>
</html>